package com.hudson.plugin;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Coverage entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "coverage", catalog = "reportdb")
public class Coverage implements java.io.Serializable {

    // Fields

    private Integer buildId;
    private Builds builds;
    private Float rdFuncCov;
    private Float qaFuncCov;
    private Float rdCdCov;
    private Float qaCdCov;
    private Float rdLineCov;
    private Float qaLineCov;

    // Constructors

    /**
     * default constructor
     */
    public Coverage() {
    }

    /**
     * minimal constructor
     */
    public Coverage(Builds builds) {
        this.builds = builds;
    }

    /**
     * full constructor
     */
    public Coverage(Builds builds, Float rdFuncCov, Float qaFuncCov,
                    Float rdCdCov, Float qaCdCov, Float rdLineCov, Float qaLineCov) {
        this.builds = builds;
        this.rdFuncCov = rdFuncCov;
        this.qaFuncCov = qaFuncCov;
        this.rdCdCov = rdCdCov;
        this.qaCdCov = qaCdCov;
        this.rdLineCov = rdLineCov;
        this.qaLineCov = qaLineCov;
    }

    // Property accessors
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "build_id", unique = true, nullable = false)
    public Integer getBuildId() {
        return this.buildId;
    }

    public void setBuildId(Integer buildId) {
        this.buildId = buildId;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "build_id", unique = true, nullable = false, insertable = false, updatable = false)
    public Builds getBuilds() {
        return this.builds;
    }

    public void setBuilds(Builds builds) {
        this.builds = builds;
    }

    @Column(name = "rd_func_cov", precision = 12, scale = 0)
    public Float getRdFuncCov() {
        return this.rdFuncCov;
    }

    public void setRdFuncCov(Float rdFuncCov) {
        this.rdFuncCov = rdFuncCov;
    }

    @Column(name = "qa_func_cov", precision = 12, scale = 0)
    public Float getQaFuncCov() {
        return this.qaFuncCov;
    }

    public void setQaFuncCov(Float qaFuncCov) {
        this.qaFuncCov = qaFuncCov;
    }

    @Column(name = "rd_cd_cov", precision = 12, scale = 0)
    public Float getRdCdCov() {
        return this.rdCdCov;
    }

    public void setRdCdCov(Float rdCdCov) {
        this.rdCdCov = rdCdCov;
    }

    @Column(name = "qa_cd_cov", precision = 12, scale = 0)
    public Float getQaCdCov() {
        return this.qaCdCov;
    }

    public void setQaCdCov(Float qaCdCov) {
        this.qaCdCov = qaCdCov;
    }

    @Column(name = "rd_line_cov", precision = 12, scale = 0)
    public Float getRdLineCov() {
        return this.rdLineCov;
    }

    public void setRdLineCov(Float rdLineCov) {
        this.rdLineCov = rdLineCov;
    }

    @Column(name = "qa_line_cov", precision = 12, scale = 0)
    public Float getQaLineCov() {
        return this.qaLineCov;
    }

    public void setQaLineCov(Float qaLineCov) {
        this.qaLineCov = qaLineCov;
    }

}